/*     */ package org.apache.taglibs.standard.tag.common.core;
/*     */ 
/*     */ import java.io.IOException;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ import javax.servlet.jsp.JspException;
/*     */ import javax.servlet.jsp.JspTagException;
/*     */ import javax.servlet.jsp.PageContext;
/*     */ import javax.servlet.jsp.tagext.BodyTagSupport;
/*     */ import org.apache.taglibs.standard.resources.Resources;
/*     */ 
/*     */ public abstract class UrlSupport extends BodyTagSupport
/*     */   implements ParamParent
/*     */ {
/**
	 * 
	 */
	private static final long serialVersionUID = 4369720991619234858L;
/*     */   protected String value;
/*     */   protected String context;
/*     */   private String var;
/*     */   private int scope;
/*     */   private ParamSupport.ParamManager params;
/*     */ 
/*     */   public UrlSupport()
/*     */   {
/*  56 */     init();
/*     */   }
/*     */ 
/*     */   private void init() {
/*  60 */     this.value = (this.var = null);
/*  61 */     this.params = null;
/*  62 */     this.context = null;
/*  63 */     this.scope = 1;
/*     */   }
/*     */ 
/*     */   public void setVar(String var)
/*     */   {
/*  71 */     this.var = var;
/*     */   }
/*     */ 
/*     */   public void setScope(String scope) {
/*  75 */     this.scope = Util.getScope(scope);
/*     */   }
/*     */ 
/*     */   public void addParameter(String name, String value)
/*     */   {
/*  84 */     this.params.addParameter(name, value);
/*     */   }
/*     */ 
/*     */   public int doStartTag()
/*     */     throws JspException
/*     */   {
/*  93 */     this.params = new ParamSupport.ParamManager();
/*  94 */     return 2;
/*     */   }
/*     */ 
/*     */   public int doEndTag()
/*     */     throws JspException
/*     */   {
/* 103 */     String baseUrl = resolveUrl(this.value, this.context, this.pageContext);
/* 104 */     String result = this.params.aggregateParams(baseUrl);
/*     */ 
/* 107 */     if (!(ImportSupport.isAbsoluteUrl(result))) {
/* 108 */       HttpServletResponse response = (HttpServletResponse)this.pageContext.getResponse();
/*     */ 
/* 110 */       result = response.encodeURL(result);
/*     */     }
/*     */ 
/* 114 */     if (this.var != null)
/* 115 */       this.pageContext.setAttribute(this.var, result, this.scope);
/*     */     else {
/*     */       try {
/* 118 */         this.pageContext.getOut().print(result);
/*     */       } catch (IOException ex) {
/* 120 */         throw new JspTagException(ex.toString(), ex);
/*     */       }
/*     */     }
///*     */ 	if(var.equals("aa.action")){
//				return super.doEndTag(); // 正常显示超链接标签，并继续执行后面的内容
//			}else{
//				return EVAL_PAGE; // 不显示当前的超链接标签，只继续执行后面的内容
//			}
/* 124 */     return 6;
/*     */   }
/*     */ 
/*     */   public void release()
/*     */   {
/* 129 */     init();
/*     */   }
/*     */ 
/*     */   public static String resolveUrl(String url, String context, PageContext pageContext)
/*     */     throws JspException
/*     */   {
/* 139 */     if (ImportSupport.isAbsoluteUrl(url)) {
/* 140 */       return url;
/*     */     }
/*     */ 
/* 143 */     HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
/*     */ 
/* 145 */     if (context == null) {
/* 146 */       if (url.startsWith("/")) {
/* 147 */         return request.getContextPath() + url;
/*     */       }
/* 149 */       return url;
/*     */     }
/* 151 */     if ((!(context.startsWith("/"))) || (!(url.startsWith("/")))) {
/* 152 */       throw new JspTagException(Resources.getMessage("IMPORT_BAD_RELATIVE"));
/*     */     }
/*     */ 
/* 155 */     if (context.equals("/"))
/*     */     {
/* 159 */       return url;
/*     */     }
/* 161 */     return context + url;
/*     */   }
/*     */ }

/* Location:           D:\workspace\TongServer\WebContent\WEB-INF\lib\standard.jar
 * Qualified Name:     org.apache.taglibs.standard.tag.common.core.UrlSupport
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.5.3
 */